package com.icss.daos;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.icss.beans.PlanVO;

public class PlanDao {
	
	Dao dao=null;
	
	
	public void insertPlan(String sql){
		
		dao=new Dao();
		boolean flag=dao.execute(sql);
		if(flag==true){
			System.out.println("工作计划添加成功");			
		}else{System.out.println("工作计划添加失败！");	}
		
		
		
	}
	
	public List<PlanVO> selectPlan(String sql){
		List<PlanVO> list=new ArrayList<PlanVO>();
		dao=new Dao();
		ResultSet rs=dao.query(sql);
		try {
			while(rs.next()){
				PlanVO vo=new PlanVO();
				vo.setPlanName(rs.getString("planName"));
				vo.setBeginTime(rs.getDate("beginTime"));
				vo.setEndTime(rs.getDate("endTime"));
				vo.setPlanContent(rs.getString("planContent"));
				vo.setPlanPartner(rs.getString("planPartner"));
				vo.setPlanRemark(rs.getString("planRemark"));
				vo.setPlanContent(rs.getString("planContent"));
				vo.setPlanState(rs.getBoolean("planState"));
				list.add(vo);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return list;
	}
	

}
